package com.cskaoyan.controller.goods;

import com.cskaoyan.bean.bo.commitbo.CommitBo;
import com.cskaoyan.bean.common.BasePageInfo;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.bean.po.MarketComment;
import com.cskaoyan.service.goods.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @Description:todo 商品管理的评论模块
* @Author:todo wang xv
* @Date:todo 2022/11/21
*/
@RestController
@RequestMapping("admin/comment")
public class CommentController {
    @Autowired
    CommentService commentService;

    /**
    * @Description:todo 显示查询商品评论 GET
    * @Author:todo wang xv
    * @Date:todo 2022/11/21
    */
    @RequestMapping("list")
    public BaseRespVo queryCommentList(CommitBo info){
       CommonData<MarketComment> data = commentService.queryCommentList(info);
       return BaseRespVo.succeed(data);
        
    }

    /**
    * @Description:todo 删除商品评论
    * @Author:todo wang xv
    * @Date:todo 2022/11/21
    */
    @RequestMapping("delete")
    public BaseRespVo deleteComment(@RequestBody MarketComment comment){
        commentService.deleteComment(comment);
        return BaseRespVo.succeed();
    }
}
